<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>换肤</title>
		<link id="linkS" rel="stylesheet" type="text/css" href="css/pink.css"/>
		<script type="text/javascript">
			var mytheme=localStorage.getItem("theme");//获取数据
			
			if(mytheme!=null){
				//如果不等于空，就应该使用存储的键所对应的那个文件 
				document.getElementById("linkS").href=mytheme;
			}else{
				//否则就使用默认样式
				document.getElementById("linkS").href= "css/pink.css";
			}
			
			function bianse(changeColor){
				var newC="css/" + changeColor + ".css";
				document.getElementById("linkS").href= newC;
				localStorage.setItem("theme" ,newC ); //存储在浏览器中，下次打开时为存储的样式
			}
		</script>
	</head>
	<body>
		<input type ="button" value="浅绿主题" onclick="bianse('lightgreen')"/>
		<input type ="button" value="橙主题" onclick="bianse('orange')"/>
	</body>
</html>
